home *** CD-ROM | disk | FTP | other *** search
- #include <exec/exec.h>
- #include <exec/memory.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
-
- #include <clib/exec_protos.h>
- struct ConfBase
- {
- char Name[30];
- int Value;
- };
-
- struct ConfBase *Temp[1000];
- main()
- {
- int i;
- struct ConfBase conf;
- for(i=0;i<999;i++)
- {
- Temp[i]=(struct ConfBase *)AllocMem(sizeof(struct ConfBase),MEMF_CLEAR);
- Temp[i]->Value=i;
- }
- printf("Value of Struct 1= %d\n",Temp[0]->Value);
- printf("Value of Struct 5= %d\n",Temp[4]->Value);
- conf.Value=10;
-
- CopyMem((APTR)&conf,(APTR)Temp[0],sizeof(struct ConfBase));
-
- printf("Value of Struct 1= %d\n",Temp[0]->Value);
-
- CopyMem((APTR)Temp[4],(APTR)&conf,sizeof(struct ConfBase));
-
- printf("Value of conf = %d\n",conf.Value);
-
- for(i=0;i<999;i++)
- {
- FreeMem((APTR)Temp[i],sizeof(struct ConfBase));
- }
- exit(0);
- }